#pragma once
#include "Obstacle.h"

class LockedObstacle : public Obstacle {
protected:
	LockType m_lockType;
	bool m_locked;
public:
	LockedObstacle(GenericType type, LockType lockType = LT_NONE, bool locked = false);
	LockedObstacle(GenericType type, std::ifstream& file);
	virtual ~LockedObstacle();
	LockType getLockType() const;
	bool isLocked() const;
	void lock();
	void unlock();
	virtual bool toggleLock();
	void breakLock(bool destroyed);
	void save(std::ofstream& file) const;
};

inline LockType LockedObstacle::getLockType() const {return m_lockType;}
inline bool LockedObstacle::isLocked() const {return m_locked;}
inline void LockedObstacle::lock() {m_locked = true;}
inline void LockedObstacle::unlock() {m_locked = false;}